package com.woniuxy.mesboot.security;

import com.woniuxy.mesboot.entity.SysUser;
import com.woniuxy.mesboot.vo.MenuVO;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

/**
 * @author ：lisir
 * @date ：Created in 2023/5/30 10:45
 * @description：TODO
 */
@Data
public class LoginUser implements UserDetails {

    private SysUser user;
    private List<MenuVO> menuVOS;
    private Integer status;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return user.getPassword();
    }

    @Override
    public String getUsername() {
        return user.getUserName();
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
